<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
require_once( JPATH_COMPONENT.DS.'helpers'.DS.'farm.php' );

class FarmViewSumary extends JView
{
	function display()
	{
		$layout = JRequest::getVar('layout');
		
		switch($layout){
			case 'record':
				$t = JTable::getInstance('plantPlan', 'Table');
				if (!empty($_GET['ppid'])) 
					$this->assignRef('data', $t->getFutureRecord($_GET['ppid']));
				break;
			case 'environment':
				$t = JTable::getInstance('environmentRecord', 'Table');
				if (!empty($_GET['oid'])) 
					$this->assignRef('data', $t->eoList($_GET['oid']));
				break;
			default:
				break;
		}
		parent::display();
	}
}
